1. Field of the Invention
This invention relates generally to the field of computer processors. More particularly, the invention relates to a cache coherency apparatus and method for minimizing memory writeback operations.
2. Description of the Related Art
The most popular multi-socket cache coherence protocols used today are MESI (Modified Exclusive Shared Invalid), MOESI (Modified Owned Exclusive Shared Invalid), and MESIM′ (where the M′ state designates a modified line which has been read by a peer but is not immediately written back to memory). MESI and MESIM′ both have the advantage of providing exclusive ownership to the first socket to read a line after receiving a dirty snoop response from another socket that recently wrote its copy of the line.
The benefit that MESIM′ has over MESI is that MESI requires the line to be immediately be written to memory before providing exclusive ownership to the first reader, while the M′ state of MESIM′ allows that write-back to memory to be delayed until a second read (by some other socket) occurs. However, if there is more than a single reader after each writer, both MESI and MESIM′ will eventually write the dirty data for each write to memory.
MOESI, on the other hand, can eliminate the write-back to memory. For example, the “Owned” (O) state indicates that the owner is one of several valid copies of the cache line, but has the exclusive right to make changes to it. It must broadcast any changes to all other caches sharing the line. The introduction of Owned state allows dirty sharing of data because a modified cache line can be moved between various caches without writing back the cache line to main memory. The cache line may be changed to the Modified state after invalidating all shared copies, or changed to the Shared state by writing the modifications back to main memory. However, MOESI does not allow the first reader after each writer to get an exclusive copy of the line, which can degrade performance on some Online Transaction Processing (OLTP) workloads.